package com.kexio.file.dto;

import java.io.InputStream;

/**
 * 文件分片
 * 
 * @author kexio
 */
public class FileChunk {
    
    /** 分片编号 */
    private int chunkNumber;
    
    /** 分片大小 */
    private long chunkSize;
    
    /** 分片数据流 */
    private InputStream inputStream;
    
    /** 分片哈希值 */
    private String chunkHash;
    
    /** 总分片数 */
    private int totalChunks;

    // ==================== 构造函数 ====================
    
    public FileChunk() {}

    public FileChunk(int chunkNumber, long chunkSize, InputStream inputStream) {
        this.chunkNumber = chunkNumber;
        this.chunkSize = chunkSize;
        this.inputStream = inputStream;
    }

    // ==================== Getter/Setter方法 ====================
    
    public int getChunkNumber() { return chunkNumber; }
    public void setChunkNumber(int chunkNumber) { this.chunkNumber = chunkNumber; }

    public long getChunkSize() { return chunkSize; }
    public void setChunkSize(long chunkSize) { this.chunkSize = chunkSize; }

    public InputStream getInputStream() { return inputStream; }
    public void setInputStream(InputStream inputStream) { this.inputStream = inputStream; }

    public String getChunkHash() { return chunkHash; }
    public void setChunkHash(String chunkHash) { this.chunkHash = chunkHash; }

    public int getTotalChunks() { return totalChunks; }
    public void setTotalChunks(int totalChunks) { this.totalChunks = totalChunks; }
}
